# Time    : 2019/6/10 上午10:26
# Author  : zw
# File    : filters.py
# Software: PyCharm

import django_filters
from django.db.models import Count, F

from modelfields.bit_choice_field import bit_choice_filter_method

from . import models


class DemoFilter(django_filters.rest_framework.FilterSet):
    direction__in = django_filters.CharFilter(method=bit_choice_filter_method, field_name='direction')

    class Meta:
        model = models.Demo
        fields = {
            "origin": ['in'],  # 所属分类
        }
